package InputStream;import java.io.Serializable;import java.io.*;//初始化对象，用输入流读取data.ser输出流的数据，将数据转化为对象流， stu读取数据流readObject()，关闭；public class ObjectRecov implements Serializable {    public static void main(String[] args) {        Student stu = null;        try{            FileInputStream fi = new FileInputStream("data.ser");            ObjectInputStream in = new ObjectInputStream(fi);            try {                stu = (Student)in.readObject();            } catch (ClassNotFoundException e) {                e.printStackTrace();            }            in.close();        }catch (IOException e){            System.out.println(e);        }        System.out.println("ID: " + stu.id + " name: " + stu.name +" age: " +stu.age +" dept: " +stu.department);    }}